package com.baor.controller;


import com.baor.domain.ParkingVo;
import com.baor.service.ParkingService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@Component
@RequestMapping("/carParking")
public class ParkingController {

    @Autowired
    private ParkingService parkingService;

    @RequestMapping("/carParkingList")
    public AjaxResult<?> parkingList(@RequestBody Map<String,Object> params){
        return parkingService.carParkList(params);
    }

    @RequestMapping("/addParking")
    public AjaxResult<?> insert(@RequestBody Map<String,Object> params){
        return parkingService.addParking(params);
    }

    @RequestMapping("/updateParking")
    public AjaxResult<?> update(@RequestBody Map<String,Object> params){
        return parkingService.updateParking(params);
    }

    @RequestMapping("/delete")
    public AjaxResult<?> delete(int parkingId){
        return parkingService.delete(parkingId);
    }

    @RequestMapping("/parkingListInfo")
    public AjaxResult<?> parkingInfo(@RequestBody Map<String,Object> params){
        return parkingService.parkingListInfo(params);
    }


}
